<template lang="">
    <div class = "chart-box" />
</template>
<script>
import * as echarts from 'echarts';
export default {
    props:['option'],
    data(){
        return{
            chartRef:null
        }
    },
    mounted(){
        this.chartRef = echarts.init(this.$el);
        this.updataChart();
    },
    methods:{
        updataChart(){
            if(!this.option) return;
            this.chartRef.setOption(this.option)
        }
    }
    
}
</script>
<style lang="scss">
    .chart-box{
        width:100%;
        height:100%;
    }
    
</style>